// 最近表示包括当前  过去表示不包括当前
export const dateShortcutKeyJS = {
  data() {
    return {
      choiceDate: '',
      pickerOptions: {
        shortcuts: [
          {
            text: this.$t('today'),
            onClick: picker => {
              const start = new Date();
              picker.$emit('pick', [start, start]);
            }
          },
          {
            text: this.$t('yesterday'),
            onClick: picker => {
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
              picker.$emit('pick', [start, start]);
            }
          },
          {
            text: this.$t('this_week'), // 从周一算起
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days =                new Date().getDay() == 0 ? 6 : new Date().getDay() - 1;
              start.setTime(start.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$t('this_month'),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days = new Date().getDate() - 1;
              start.setTime(start.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_days', { N: 7 }),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_days', { N: 30 }),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 29);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_weeks', { N: 6 }),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days = new Date().getDay() - 1 + 35;
              start.setTime(start.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_months', { N: 6 }),
            onClick: picker => {
              const end = new Date();
              const start = new Date(
                new Date().getFullYear(),
                new Date().getMonth() - 5,
                1
              );
              picker.$emit('pick', [start, end]);
            }
          }
        ],
        onPick: ({ maxDate, minDate }) => {
          this.choiceDate = minDate.getTime();
          if (maxDate) {
            this.choiceDate = '';
          }
        },
        // 限制手动选择时间不能超过31天
        disabledDate: time => {
          const tt = time.getTime();
          const nt = Date.now();
          if (tt > nt) return true;

          if (this.choiceDate) {
            const one = 30 * 24 * 3600 * 1000;
            const minTime = this.choiceDate - one;
            const maxTime = this.choiceDate + one;
            if (tt < minTime || tt > maxTime) return true;
          }

          return false;
        }
      },
      pickerOptions2: {
        shortcuts: [
          {
            text: this.$t('today'),
            onClick: picker => {
              const start = new Date();
              picker.$emit('pick', [start, start]);
            }
          },
          {
            text: this.$t('yesterday'),
            onClick: picker => {
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
              picker.$emit('pick', [start, start]);
            }
          },
          {
            text: this.$t('this_week'), // 从周一算起
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days =                new Date().getDay() == 0 ? 6 : new Date().getDay() - 1;
              start.setTime(start.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$t('this_month'),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days = new Date().getDate() - 1;
              start.setTime(start.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_days', { N: 7 }), // 过去7天 不包括今天 共7天
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_days', { N: 30 }), // 过去30天 不包括今天 共30天
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_weeks', { N: 6 }), // 过去6个完整周 不包括本周
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days = new Date().getDay() == 0 ? 7 : new Date().getDay();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * (days + 41));
              end.setTime(end.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_months', { N: 6 }), // 前6月  不包括本月
            onClick: picker => {
              const start = new Date(
                new Date().getFullYear(),
                new Date().getMonth() - 6,
                1
              );
              const days = new Date(
                new Date().getFullYear(),
                new Date().getMonth(),
                0
              ).getDate();
              const end = new Date(
                new Date().getFullYear(),
                new Date().getMonth() - 1,
                days
              );
              picker.$emit('pick', [start, end]);
            }
          }
        ],
        onPick: ({ maxDate, minDate }) => {
          this.choiceDate = minDate.getTime();
          if (maxDate) {
            this.choiceDate = '';
          }
        },
        // 限制手动选择时间不能超过31天
        disabledDate: time => {
          const tt = time.getTime();
          const nt = Date.now();
          if (tt > nt) return true;

          if (this.choiceDate) {
            const one = 30 * 24 * 3600 * 1000;
            const minTime = this.choiceDate - one;
            const maxTime = this.choiceDate + one;
            if (tt < minTime || tt > maxTime) return true;
          }

          return false;
        }
      },
      pickerOptions3: {
        shortcuts: [
          {
            text: this.$t('today'),
            onClick: picker => {
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
              picker.$emit('pick', [start, start]);
            }
          },
          {
            text: this.$t('this_week'), // 从周一算起
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days =                new Date().getDay() == 0 ? 6 : new Date().getDay() - 1;
              start.setTime(start.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$t('this_month'),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              const days = new Date().getDate() - 1;
              start.setTime(start.getTime() - 3600 * 1000 * 24 * days);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_days', { N: 7 }),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
              picker.$emit('pick', [start, end]);
            }
          },
          {
            text: this.$tt('last_N_days', { N: 30 }),
            onClick: picker => {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
              picker.$emit('pick', [start, end]);
            }
          }
        ],
        onPick: ({ maxDate, minDate }) => {
          this.choiceDate = minDate.getTime();
          if (maxDate) {
            this.choiceDate = '';
          }
        },
        // 限制手动选择时间不能超过31天
        disabledDate: time => {
          const tt = time.getTime();
          const nt = Date.now();
          if (tt > nt) return true;

          if (this.choiceDate) {
            const one = 30 * 24 * 3600 * 1000;
            const minTime = this.choiceDate - one;
            const maxTime = this.choiceDate + one;
            if (tt < minTime || tt > maxTime) return true;
          }

          return false;
        }
      },
      sortStrategyArrayA: [], // A组排序推荐全部策略
      sortStrategyArrayB: [], // B组排序推荐全部策略
      sortStrategyArrayC: [], // c组排序推荐全部策略
      sortStrategyArrayD: [], // D组排序推荐全部策略
      dataNameMap: {},
      dataNameMap2: {}
    };
  },

  filters: {
    // 判断跳转的页面
    jumpPage(row, lan) {
      const { pageType, level1, level2, link, showType } = row;
      let redirectTarget = '';
      if (lan == 'zh') {
        // 推广showType 1-内链 2-外链 3-资讯ID (推广中使用) 4-话题ID'
        if (showType) {
          switch (showType) {
            case 1:
            case 2:
              redirectTarget = link;
              break;
            case 3:
              redirectTarget = '资讯页面';
              break;
            case 4:
              redirectTarget = '话题详情页';
          }

          return redirectTarget;
        }

        if (pageType == 1) {
          redirectTarget = '资讯详情';
        }
        if (pageType == 2) {
          // 生活页面
          switch (level1) {
            case 11: // 房地产
              switch (level2) {
                case 0:
                  redirectTarget = '房地产';
                  break;
                case 31:
                  redirectTarget = '二手房';
                  break;
                case 32:
                  redirectTarget = '新房';
                  break;
                case 33:
                  redirectTarget = '租房';
                  break;
                case 34:
                  redirectTarget = '写字楼';
                  break;
                case 35:
                  redirectTarget = '厂房';
                  break;
                case 36:
                  redirectTarget = '仓库';
                  break;
                case 37:
                  redirectTarget = '商铺';
                  break;
                case 38:
                  redirectTarget = '土地';
                  break;
              }
              break;
            case 12: // 周边商家
              switch (level2) {
                case 0:
                  redirectTarget = '周边商家';
                  break;
                case 39:
                  redirectTarget = '美食';
                  break;
                case 40:
                  redirectTarget = '娱乐';
                  break;
                case 41:
                  redirectTarget = '旅行';
                  break;
                case 42:
                  redirectTarget = '购物';
                  break;
                case 43:
                  redirectTarget = '健身';
                  break;
                case 44:
                  redirectTarget = '医疗';
                  break;
                case 45:
                  redirectTarget = '教育';
                  break;
                case 46:
                  redirectTarget = '服务';
                  break;
              }
              break;
            case 13: // "招聘求职";
              switch (level2) {
                case 0:
                  redirectTarget = '招聘求职';
                  break;
                case 47:
                  redirectTarget = '销售';
                  break;
                case 48:
                  redirectTarget = '建筑/工程';
                  break;
                case 49:
                  redirectTarget = '行政';
                  break;
                case 50:
                  redirectTarget = '司机/保安';
                  break;
                case 51:
                  redirectTarget = '技工/保养';
                  break;
                case 52:
                  redirectTarget = '操作/生产';
                  break;
                case 53:
                  redirectTarget = '教育培训';
                  break;
                case 54:
                  redirectTarget = '更多分类';
                  break;
              }
              break;
            case 14: // "交易买卖"
              switch (level2) {
                case 0:
                  redirectTarget = '交易买卖';
                  break;
                case 55:
                  redirectTarget = '手机/平板';
                  break;
                case 56:
                  redirectTarget = '电子数码';
                  break;
                case 57:
                  redirectTarget = '家电';
                  break;
                case 58:
                  redirectTarget = '汽车';
                  break;
                case 59:
                  redirectTarget = '摩托车';
                  break;
                case 60:
                  redirectTarget = '服装';
                  break;
                case 61:
                  redirectTarget = '家居';
                  break;
                case 62:
                  redirectTarget = '更多分类';
                  break;
              }
              break;
            case 15: // 便民服务
              switch (level2) {
                case 0:
                  redirectTarget = '便民服务';
                  break;
                case 63:
                  redirectTarget = '手机充值';
                  break;
                case 64:
                  redirectTarget = '本地黄页';
                  break;
                case 65:
                  redirectTarget = '柬文翻译';
                  break;
                case 66:
                  redirectTarget = '本地汇率';
                  break;
                case 67:
                  redirectTarget = '出入境指南';
                  break;
                case 68:
                  redirectTarget = '柬文学习';
                  break;
              }
              break;
            case 16: // "折扣优惠"
              switch (level2) {
                case 0:
                  redirectTarget = '折扣优惠';
                  break;
                case 69:
                  redirectTarget = '美食餐饮';
                  break;
                case 70:
                  redirectTarget = '休闲娱乐';
                  break;
                case 71:
                  redirectTarget = '购物卖场';
                  break;
                case 72:
                  redirectTarget = '时尚女性';
                  break;
                case 73:
                  redirectTarget = '汽车服务';
                  break;
                case 74:
                  redirectTarget = '家居装饰';
                  break;
                case 75:
                  redirectTarget = '培训机构';
                  break;
                case 76:
                  redirectTarget = '更多优惠';
                  break;
              }
              break;
            case 17:
              redirectTarget = '寻人求助';
              break;
            case 18:
              redirectTarget = '手机充值';
              break;
            case 19:
              redirectTarget = '地图找房';
              break;
            case 20:
              redirectTarget = '乐享购物';
              break;
            case 21:
              redirectTarget = '实时汇率';
              break;
            case 22:
              redirectTarget = '钱包';
              break;
            case 23:
              redirectTarget = '账单';
              break;
            case 24:
              redirectTarget = '提现';
              break;
            case 25:
              redirectTarget = '优化建议';
              break;
            case 26:
              redirectTarget = '打车';
              break;
            case 27:
              redirectTarget = '转盘抽奖';
              break;
            case 28:
              redirectTarget = '金币翻倍';
              break;
            case 29:
              redirectTarget = '送水节领红包';
              break;
            case 30:
              redirectTarget = '龙舟竞猜';
              break;
            case 31:
              redirectTarget = '金币兑换';
              break;
            case 32:
              redirectTarget = '金币商城';
              break;
            case 33:
              redirectTarget = '柬新年祈福';
              break;
            case 34:
              redirectTarget = '自媒体申请';
              break;
            case 35:
              redirectTarget = '微头条详情';
              break;
            case -1:
              redirectTarget = '其他H5页面';
              break;
          }
        }
        if (pageType == 3) {
          // 其他页面
          if (level1 == 1 || level1 == 2 || level1 == 3) {
            // 我的  账号页 发布页
            switch (level2) {
              case 0:
                redirectTarget = '我的';
                break;
              case 1:
                redirectTarget = '我的资料';
                break;
              case 2:
                redirectTarget = '账号设置';
                break;
              case 3:
                redirectTarget = '热门活动';
                break;
              case 4:
                redirectTarget = '消息通知';
                break;
              case 5:
                redirectTarget = '个人主页';
                break;
              case 6:
                redirectTarget = '在线客服';
                break;
              case 7:
                redirectTarget = '自媒体申请';
                break;
              case 8:
                redirectTarget = '系统设置';
                break;
              case 9:
                redirectTarget = '收藏页';
                break;
              case 10:
                redirectTarget = '任务中心';
                break;
              case 11:
                redirectTarget = '邀请好友';
                break;
              case 12:
                redirectTarget = '输入邀请码';
                break;
              case 13:
                redirectTarget = '注册页';
                break;
              case 14:
                redirectTarget = '登录页';
                break;
              case 15:
                redirectTarget = '手机绑定页';
                break;
              case 16:
                redirectTarget = '我要爆料';
                break;
              case 17:
                redirectTarget = '发布微头条';
                break;
              case 18:
                redirectTarget = '发布小视频';
                break;
              case 19:
                redirectTarget = '发布视频';
                break;
            }
          }
          if (level1 == 4) {
            redirectTarget = '小视频';
          }
          if (level1 == 5) {
            redirectTarget = '视频';
          }
          if (level1 == 6) {
            redirectTarget = '自媒体申请';
          }
          if (level1 == 7) {
            redirectTarget = 'App生活首页';
          }
          if (level1 == 8 && level2 == 20) {
            redirectTarget = '热议页面';
          }
          if (level1 == 8 && level2 == 21) {
            redirectTarget = '话题榜单';
          }
          if (level1 == 9) {
            redirectTarget = '话题详情页';
          }
        }

        if (pageType == 4) {
          redirectTarget = '第三方链接';
        }
      } else {
        // 推广showType 1-内链 2-外链 3-资讯ID (推广中使用) 4-话题ID'
        if (showType) {
          switch (showType) {
            case 1:
            case 2:
              redirectTarget = link;
              break;
            case 3:
              redirectTarget = 'Information for details';
              break;
            case 4:
              redirectTarget = 'Topic details page';
          }

          return redirectTarget;
        }

        if (pageType == 1) {
          redirectTarget = 'Information for details';
        }
        if (pageType == 2) {
          // 生活页面
          switch (level1) {
            case 11: // 房地产
              switch (level2) {
                case 0:
                  redirectTarget = 'real estate';
                  break;
                case 31:
                  redirectTarget = 'Second-hand housing';
                  break;
                case 32:
                  redirectTarget = 'new house';
                  break;
                case 33:
                  redirectTarget = 'renting';
                  break;
                case 34:
                  redirectTarget = 'office building';
                  break;
                case 35:
                  redirectTarget = 'factory';
                  break;
                case 36:
                  redirectTarget = 'warehouse';
                  break;
                case 37:
                  redirectTarget = 'shop';
                  break;
                case 38:
                  redirectTarget = 'land';
                  break;
              }
              break;
            case 12: // 周边商家
              switch (level2) {
                case 0:
                  redirectTarget = 'Publish merchant';
                  break;
                case 39:
                  redirectTarget = 'Gourmet';
                  break;
                case 40:
                  redirectTarget = 'entertainment';
                  break;
                case 41:
                  redirectTarget = 'travel';
                  break;
                case 42:
                  redirectTarget = 'shopping';
                  break;
                case 43:
                  redirectTarget = 'fitness';
                  break;
                case 44:
                  redirectTarget = 'medical';
                  break;
                case 45:
                  redirectTarget = 'education';
                  break;
                case 46:
                  redirectTarget = 'service';
                  break;
              }
              break;
            case 13: // "招聘求职";
              switch (level2) {
                case 0:
                  redirectTarget = 'job';
                  break;
                case 47:
                  redirectTarget = 'Sales';
                  break;
                case 48:
                  redirectTarget = 'Architecture';
                  break;
                case 49:
                  redirectTarget = 'Admin';
                  break;
                case 50:
                  redirectTarget = 'Chauffeur';
                  break;
                case 51:
                  redirectTarget = 'Technician';
                  break;
                case 52:
                  redirectTarget = 'Operation';
                  break;
                case 53:
                  redirectTarget = 'recruitEducation';
                  break;
                case 54:
                  redirectTarget = 'More';
                  break;
              }
              break;
            case 14: // "交易买卖"
              switch (level2) {
                case 0:
                  redirectTarget = 'trading';
                  break;
                case 55:
                  redirectTarget = 'Phone';
                  break;
                case 56:
                  redirectTarget = 'Digital';
                  break;
                case 57:
                  redirectTarget = 'Applicance';
                  break;
                case 58:
                  redirectTarget = 'Car';
                  break;
                case 59:
                  redirectTarget = 'Motorcycle';
                  break;
                case 60:
                  redirectTarget = 'Clothing';
                  break;
                case 61:
                  redirectTarget = 'Decor';
                  break;
                case 62:
                  redirectTarget = 'More';
                  break;
              }
              break;
            case 15: // 便民服务
              switch (level2) {
                case 0:
                  redirectTarget = 'Convenience service';
                  break;
                case 63:
                  redirectTarget = 'Phone top-up';
                  break;
                case 64:
                  redirectTarget = 'Local Yellow Pages';
                  break;
                case 65:
                  redirectTarget = 'Khmer translation';
                  break;
                case 66:
                  redirectTarget = 'local exchange rate';
                  break;
                case 67:
                  redirectTarget = 'entry and exit guide';
                  break;
                case 68:
                  redirectTarget = 'Khmer learning';
                  break;
              }
              break;
            case 16: // "折扣优惠"
              switch (level2) {
                case 0:
                  redirectTarget = 'Discount';
                  break;
                case 69:
                  redirectTarget = 'Restaurant';
                  break;
                case 70:
                  redirectTarget = 'Entertainment';
                  break;
                case 71:
                  redirectTarget = 'Shopping';
                  break;
                case 72:
                  redirectTarget = 'Fashion';
                  break;
                case 73:
                  redirectTarget = 'Car service';
                  break;
                case 74:
                  redirectTarget = 'Decoration';
                  break;
                case 75:
                  redirectTarget = 'Training';
                  break;
                case 76:
                  redirectTarget = 'Discount';
                  break;
              }
              break;
            case 17:
              redirectTarget = 'search for help';
              break;
            case 18:
              redirectTarget = 'Phone top-up';
              break;
            case 19:
              redirectTarget = 'map to find a room';
              break;
            case 20:
              redirectTarget = 'enjoy shopping';
              break;
            case 21:
              redirectTarget = 'real-time exchange rate';
              break;
            case 22:
              redirectTarget = 'wallet';
              break;
            case 23:
              redirectTarget = 'order';
              break;
            case 24:
              redirectTarget = 'Withdraw';
              break;
            case 25:
              redirectTarget = 'Optimize suggestion';
              break;
            case 26:
              redirectTarget = 'Call taxi';
              break;
            case 27:
              redirectTarget = 'Lucky draw win prize';
              break;
            case 28:
              redirectTarget = 'Double gold coin';
              break;
            case 29:
              redirectTarget = 'Red Packet for Water Festival';
              break;
            case 30:
              redirectTarget = 'Dragon Boat Racing';
              break;
            case 31:
              redirectTarget = 'Gold Exchange';
              break;
            case 32:
              redirectTarget = 'Coin Mall';
              break;
            case 33:
              redirectTarget = 'Cambodia New Year is blessing';
              break;
            case 34:
              redirectTarget = 'Wemedia Application';
              break;
            case 35:
              redirectTarget = 'Micro headline details';
              break;
            case -1:
              redirectTarget = 'other_h5_page';
              break;
          }
        }
        if (pageType == 3) {
          // 其他页面
          if (level1 == 1 || level1 == 2 || level1 == 3) {
            // 我的  账号页 发布页
            switch (level2) {
              case 0:
                redirectTarget = 'Mine';
                break;
              case 1:
                redirectTarget = 'My profile';
                break;
              case 2:
                redirectTarget = 'Account settings';
                break;
              case 3:
                redirectTarget = 'Popular events';
                break;
              case 4:
                redirectTarget = 'Notification';
                break;
              case 5:
                redirectTarget = 'User newsfeed';
                break;
              case 6:
                redirectTarget = 'Online customer service';
                break;
              case 7:
                redirectTarget = 'WeMedia application';
                break;
              case 8:
                redirectTarget = 'System settings';
                break;
              case 9:
                redirectTarget = 'Collection';
                break;
              case 10:
                redirectTarget = 'Mission center';
                break;
              case 11:
                redirectTarget = 'Invite Friends';
                break;
              case 12:
                redirectTarget = 'enter invitation code';
                break;
              case 13:
                redirectTarget = 'Register';
                break;
              case 14:
                redirectTarget = 'Log in';
                break;
              case 15:
                redirectTarget = 'Binding phone';
                break;
              case 16:
                redirectTarget = 'Report';
                break;
              case 17:
                redirectTarget = 'Publish News Feed';
                break;
              case 18:
                redirectTarget = 'Publish a small video';
                break;
              case 19:
                redirectTarget = 'Release video';
                break;
            }
          }
          if (level1 == 4) {
            redirectTarget = 'Short video';
          }
          if (level1 == 5) {
            redirectTarget = 'video';
          }
          if (level1 == 6) {
            redirectTarget = 'Wemedia Application';
          }
          if (level1 == 7) {
            redirectTarget = 'App Life Home';
          }
          if (level1 == 8 && level2 == 20) {
            redirectTarget = 'Hot Topics page';
          }
          if (level1 == 8 && level2 == 21) {
            redirectTarget = 'Topic List';
          }
          if (level1 == 9) {
            redirectTarget = 'Topic details page';
          }
        }

        if (pageType == 4) {
          redirectTarget = 'Third party links';
        }
      }

      return redirectTarget || link;
    }
  },

  methods: {
    arrayFilter(type = 1) {
      if (type === 1) {
        this.dataNameMap = {};

        if (this.listQuery1.sortStrategyName1 == 'all') {
          const arr1 = this.sortStrategyArrayA;
          arr1.forEach(item => {
            const name = `A-${item}`;
            this.dataNameMap[name] = [];
          });
        } else {
          this.dataNameMap['A-line'] = [];
        }

        if (this.listQuery1.sortStrategyName2 == 'all') {
          const arr1 = this.sortStrategyArrayB;
          arr1.forEach(item => {
            const name = `B-${item}`;
            this.dataNameMap[name] = [];
          });
        } else {
          this.dataNameMap['B-line'] = [];
        }
      } else {
        this.dataNameMap2 = {};

        if (this.listQuery2.sortStrategyName1 == 'all') {
          const arr1 = this.sortStrategyArrayC;
          arr1.forEach(item => {
            const name = `A-${item}`;
            this.dataNameMap2[name] = [];
          });
        } else {
          this.dataNameMap2['A-line'] = [];
        }

        if (this.listQuery2.sortStrategyName2 == 'all') {
          const arr1 = this.sortStrategyArrayD;
          arr1.forEach(item => {
            const name = `B-${item}`;
            this.dataNameMap2[name] = [];
          });
        } else {
          this.dataNameMap2['B-line'] = [];
        }
      }
    },

    getLegendAndseries(objName, type) {
      const obj = type == 2 ? this.dataNameMap2 : this.dataNameMap;

      const legend = [];
      const series = [];
      Object.keys(obj).forEach(key => {
        const item = {
          name: key,
          type: 'line',
          data: objName[key]
        };
        legend.push(key);
        series.push(item);
      });
      return { legend, series };
    }
  }
};
